<template>
<div>
  <div>
    <p>用户名:<input type="text" v-model="form.username"></p>
    <p>密码:<input type="text" v-model="form.password"></p>
    <button @click="add">登录</button>
  </div>
</div>
</template>

<script>
export default {
  name: "School_login",
  data(){
    return{
      form:{}
    }
  },
  methods:{
    add(){
      this.$axios.post('users/loginxd/',this.form)
        .then(res=>{
          if(res.data.code==200){
            localStorage.setItem('userid',res.data.userid)
            this.$router.push('/School_show')
          }
        })
    },
  },
  mounted() {
  }
}
</script>

<style scoped>

</style>
